import { lazy } from 'react';

//一级路由
const Home = lazy(() => import("../views/Home"));


//二级路由
//归档
const File = lazy(() => import("../views/home/File/File"));
//知识小册
const Knowledge = lazy(() => import("../views/home/Knowledge/Knowledge"));
//留言板
const Messages = lazy(() => import("../views/home/Messages/Messages"));
//文章
const Paper = lazy(() => import("../views/home/Paper/Paper"));
// 关于
const Regards = lazy(() => import("../views/home/Regards/Regards"));
//四人共用的详情路由
const FileDetails = lazy(() => import("../views/home/FileDetails/FileDetails"));
//知识小册详情路由
const BrochureDetail = lazy(() => import("../views/home/Brochure_detail/BrochureDetail"))


//三级路由
// 后端
const AfterRoutes = lazy(() => import("../views/home/ThreeRoutes/After_routes/AfterRoutes"));
//所有
const AllRoutes = lazy(() => import("../views/home/ThreeRoutes/All_routes.tsx/AllRoutes"));
//要闻
const FocusRoutes = lazy(() => import("../views/home/ThreeRoutes/Focus_routes/FocusRoutes"));
//前端
const FontRoutes = lazy(() => import("../views/home/ThreeRoutes/Font_routes.tsx/FontRoutes"));
//LeetCode
const LeetCoderoutes = lazy(() => import("../views/home/ThreeRoutes/LeetCode_routes/LeetCoderoutes"));
//Linux
const LinuxRoutes = lazy(() => import("../views/home/ThreeRoutes/Linux_routes/LinuxRoutes"));
//阅读
const ReadRoutes = lazy(() => import("../views/home/ThreeRoutes/Read_routes/ReadRoutes"));


const routes = [
    //一级路由的
    //主页面
    {
        path: '/home',
        component: Home,
        //二级路由
        children: [
            {
                name: "文章",
                path: "/home/paper",
                component: Paper,
                //三级路由
                children: [
                    //所有
                    {
                        name: "所有",
                        path: "/home/paper/allRoutes",
                        component: AllRoutes
                    },
                    //前端
                    {
                        name: "前端",
                        path: "/home/paper/fontRoutes",
                        component: FontRoutes
                    },
                    //后端
                    {
                        name: "后端",
                        path: "/home/paper/afterRoutes",
                        component: AfterRoutes
                    },
                    //阅读
                    {
                        name: "阅读",
                        path: "/home/paper/readRoutes",
                        component: ReadRoutes
                    },
                    //Linux
                    {
                        name: "Linux",
                        path: "/home/paper/linuxRoutes",
                        component: LinuxRoutes
                    },
                    //LeetCode
                    {
                        name: "LeetCode",
                        path: "/home/paper/leetCoderoutes",
                        component: LeetCoderoutes
                    },
                    //要闻
                    {
                        name: "要闻",
                        path: "/home/paper/focusRoutes",
                        component: FocusRoutes
                    },
                    //三级重定向
                    {
                        from: "/home/paper",
                        to: "/home/paper/allRoutes"
                    }
                ]
            },
            {
                name: "归档",
                path: "/home/file",
                component: File
            },
            {
                name: "知识小册",
                path: "/home/knowledge",
                component: Knowledge
            },
            {
                name: "留言板",
                path: "/home/messages",
                component: Messages
            },
            {
                name: "关于",
                path: "/home/regards",
                component: Regards
            },
            //详情页file
            {
                path: "/home/fileDetails/:id",
                component: FileDetails
            },
            //知识小册详情
            {
                path: "/home/brochureDetail/:id",
                component: BrochureDetail
            },
            //二级重定向
            {
                from: "/home",
                to: "/home/paper"
            }
        ]
    },
    //一级重定向
    {
        from: '/',
        to: '/home'
    }
]


export default routes


